import { defineStore } from 'pinia'
export const useHomepageRenovateStore = defineStore('homepageRenovate', {
  state: () => {
    return {
      pageRenovate: null
    }
  },
  actions: {
    // 请求配置
    getHomePage () {
      return new Promise((resolve) => {
        http.get('/shopRenovation/homepage', {
          params: {
            renovationType: 1
          }
        })
          .then(({ data }) => {
            this.setPageRenovate(data)
            resolve(data)
          })
      })
    },
    // 更新配置
    setPageRenovate (data) {
      this.pageRenovate = data
    }
  }
})
